package pl.minim.unidefCMS.objects {
	import com.googlecode.milib.util.MLStringUtil;			

	/**
	 * @author Marek Brun
	 */
	public class UnidefDateScope extends UnidefDate {
		
		public var date2:Date=new Date();
		
		public function UnidefDateScope() {
			
		}
		
		override public function getTypeName():String {
			return 'DateScope';
		}
		
		override public function getDataAsTextPreview():String {
			return MLStringUtil.formatDateDDMMYYYY(date)+' - '+MLStringUtil.formatDateDDMMYYYY(date2);
		}
		
		override public function toXML():XML {
			var xml:XML=<i/>;
			xml.appendChild(String(date.getTime())+'|'+String(date2.getTime()));
			return xml;
		}
		
		override public function exportToRawData():* {
			return [date, date2];
		}
		
	}
}
